<?php

/**
 * This is the model class for table "ld_valid_token".
 *
 * The followings are the available columns in table 'ld_valid_token':
 * @property integer $serialno
 * @property string $user_id
 * @property string $token
 * @property string $valid_time
 * @property string $active_reset
 */
class ValidToken extends BaseActiveRecord
{
	/**
	 * Returns the static model of the specified AR class.
	 * @return ValidToken the static model class
	 */
	public static function model($className=__CLASS__)
	{
		return parent::model($className);
	}

	/**
	 * @return string the associated database table name
	 */
	public function tableName()
	{
		return 'ld_valid_token';
	}

	/**
	 * @return array validation rules for model attributes.
	 */
	public function rules()
	{
		// NOTE: you should only define rules for those attributes that
		// will receive user inputs.
		return array(
			array('user_id, active_reset', 'length', 'max'=>20),
			array('token', 'length', 'max'=>300),
			array('valid_time', 'safe'),
			// The following rule is used by search().
			// Please remove those attributes that should not be searched.
			array('serialno, user_id, token, valid_time, active_reset', 'safe', 'on'=>'search'),
		);
	}

	/**
	 * @return array relational rules.
	 */
	public function relations()
	{
		// NOTE: you may need to adjust the relation name and the related
		// class name for the relations automatically generated below.
		return array(
		);
	}

	/**
	 * @return array customized attribute labels (name=>label)
	 */
	public function attributeLabels()
	{
		return array(
			'serialno' => 'Serialno',
			'user_id' => 'User',
			'token' => 'Token',
			'valid_time' => 'Valid Time',
			'active_reset' => 'Active Reset',
		);
	}

	public function isValidToken()
        {
            
        }
}